﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace word.UserControls
{
    public partial class AutoWriteLetter : UserControl
    {
        private String lTitle;

        public String LTitle
        {
            get { return lTitle; }
            set { lTitle = value; }
        }

        private String letter;

        public String Letter
        {
            get { return letter; }
            set { letter = value; }
        }

        private int index;

        public int Index
        {
            get { return index; }
            set { index = value; }
        }


        StringBuilder StringBuilder = new StringBuilder();

        public AutoWriteLetter()
        {
            InitializeComponent();
            Index = 0;
        }

        private void AutoWriteLetter_Load(object sender, EventArgs e)
        {
            
            L_title.Text = Letter != null? LTitle : "关于";
            timer.Start();
        }

        private void timer_Tick(object sender, EventArgs e)
        {
            if (Index<Letter.Length)
            {
                RTB_Note.AppendText(Letter[Index].ToString());
                Index++;
            }
            else
            {
                timer.Stop();
            }
        }
    }
}
